using Manager;
using Player;
using UnityEngine;

namespace Game
{   /// <summary>
    /// 游戏控制类
    /// </summary>
    public class GameController:MonoBehaviour
    {
        //输入系统
        private InputManager inputManager;
        
        //玩家控制
        [SerializeField]
        private PlayerLocomotion playerLocomotion;
        //相机控制        
        [SerializeField] 
        private PlayerCameraController playerCameraController;


        private void Awake()
        {
            inputManager=InputManager.Instance;
            
        }


        //每帧更新,游戏运行函数
        private void Update()
        {

            float delta = Time.deltaTime;
            
            inputManager.HandleUpdate();
        
            playerLocomotion.HandleUpdate(delta);
            
            
           
            
            
        }

        private void LateUpdate()
        {
            float delta = Time.deltaTime;
            
            playerCameraController.HandleUpdate(delta);
            
            
        }
    }
}